<template>
  <el-container direction="vertical">

    <navMenu width="100%"></navMenu>

    <el-container direction="horizontal" style="height: 673px; background-color: #E6E6FA">
      <el-aside width="280px" height="100%">
        <sideBar class="menu" page-index="7" open-index="0"></sideBar>

      </el-aside>

      <el-main>
        <el-row :gutter="20">

          <el-col :span="14">

            <el-card shadow="hover" style="height:630px;">
              <template #header>
                <div class="clearfix">
                  <span style="font-size: 18px">系统简介</span>
                </div>
              </template>
              <p style="font-size: 18px; line-height: 45px">
                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp基于情感分析的智慧养老系统是一个人工智能项目。通过摄像头实时拍摄到的画面，
                人工智能算法实时分析老人的情感、分析是否有人摔倒、分析是否有人闯入禁止区域、分析老人是否有和义工互动并追踪义工、
                分析是否有陌生人出现并追踪陌生人。一旦上述事件发生，该事件会立即插入到数据库中。
                这些事件数据被实时地更新在报表中，管理人员因此可以迅速做出反应。
              </p>

            </el-card>
          </el-col>

          <el-col :span="10">
            <el-card shadow="hover" class="mgb20" style="height:252px;">
              <div class="user-info">
                <img src="../assets/img/touxiang.jpg" class="user-avator" alt/>
                <div class="user-info-cont">
                  <div style="font-size: 20px">用户名：{{ info.UserName }}</div>
                  <div style="font-size: 20px">身份：管理员</div>
                </div>
              </div>
            </el-card>
            <el-card shadow="hover" style="height:360px;">
              <div style="height:500px;" class="scrollbar">
                <el-scrollbar style="height:100%">
                  <el-calendar v-model="value"
                               style="width: 450px; height: 350px">
                  </el-calendar>
                </el-scrollbar>
              </div>

            </el-card>
          </el-col>

        </el-row>
      </el-main>
    </el-container>

  </el-container>

</template>

<script>
export default {
  name: "center",
  data() {
    return {
      info: [],
      value: new Date()
    }
  },
  mounted() {
    var url = document.location.href;
    if (url.indexOf("yes=") == -1) {
      var t = new Date();
      window.location.href = url + "?yes=" + t.getTime();
    }
    this.$axios.get(`http://127.0.0.1:5000/userName`).then((res) => {
      console.log(res.data);
      this.info = res.data[0];
      console.log(this.info);
    });
  }
}
</script>

<style scoped>
.el-row {
  margin-bottom: 20px;
}

.grid-content {
  display: flex;
  align-items: center;
  height: 100px;
}

.grid-cont-right {
  flex: 1;
  text-align: center;
  font-size: 14px;
  color: #999;
}

.grid-num {
  font-size: 30px;
  font-weight: bold;
}

.grid-con-icon {
  font-size: 50px;
  width: 100px;
  height: 100px;
  text-align: center;
  line-height: 100px;
  color: #fff;
}

.grid-con-1 .grid-con-icon {
  background: rgb(45, 140, 240);
}

.grid-con-1 .grid-num {
  color: rgb(45, 140, 240);
}

.grid-con-2 .grid-con-icon {
  background: rgb(100, 213, 114);
}

.grid-con-2 .grid-num {
  color: rgb(45, 140, 240);
}

.grid-con-3 .grid-con-icon {
  background: rgb(242, 94, 67);
}

.grid-con-3 .grid-num {
  color: rgb(242, 94, 67);
}

.user-info {
  display: flex;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 2px solid #ccc;
  margin-bottom: 20px;
}

.user-avator {
  width: 220px;
  height: 220px;
  border-radius: 50%;
}

.user-info-cont {
  padding-left: 50px;
  flex: 1;
  font-size: 14px;
  color: #999;
}

.user-info-cont div:first-child {
  font-size: 30px;
  color: #222;
}

.user-info-list {
  font-size: 14px;
  color: #999;
  line-height: 25px;
}

.user-info-list span {
  margin-left: 70px;
}

.mgb20 {
  margin-bottom: 20px;
}

.todo-item {
  font-size: 14px;
}

.todo-item-del {
  text-decoration: line-through;
  color: #999;
}
</style>
